package com.dmall.opening.up.records.exception;

public class BizException extends RuntimeException {

    private final String code;

    private final String message;

    private BizException(String code, String message) {
        this.code = code;
        this.message = message;
    }

    @Override
    public String getMessage() {
        return code;
    }

    public static BizException returnBeyondThePeriod() {
        return new BizException("return_beyond_the_period", "已超过退货期限");
    }

    public static BizException unsupportedOperation() {
        return new BizException("unsupported_operation", "条目当前状态下不能执行该操作");
    }
}
